home *** CD-ROM | disk | FTP | other *** search
- /* get keycode */
- #include <stdio.h>
- #include <stdlib.h>
- #include <dos.h>
-
- main () {
- int done;
- union REGS regs;
-
- done = FALSE;
- while (!done) {
- puts("Press a key");
- regs.x.ax = 0;
- int86(0x16,®s,®s);
-
- printf("Key code is Scan %x, Ascii %x.\n",regs.h.ah,regs.h.al);
-
- if (regs.h.al == 27) done = TRUE;
-
- }
- }
-